#assumes last column contains labels
function perfMat = getPerformanceMatrix(stats)
	
	classes = unique(stats(:,size(stats,2)));
	
	perfMat= zeros(size(classes,1),size(stats,2)-1);
	ansCol = size(stats,2);
	for(i=1:size(classes))
		digit=classes(i);
		for(classifier=1:size(stats,2)-1)
		
			falseNegatives = sum(stats(:,classifier)!=digit & stats(:,ansCol)==digit); 
			truePositives = sum(stats(:,classifier)==digit & stats(:,ansCol)==digit); 
			
			trueNegatives = sum(stats(:,classifier)!=digit & stats(:,ansCol)!=digit);
			falsePositives=	sum(stats(:,classifier)==digit & stats(:,ansCol)!=digit); 
			specificity = trueNegatives/(trueNegatives+falsePositives);
			sensitivity = truePositives/(truePositives+falseNegatives);
			
			perfMat(digit+1,classifier)=2*specificity*sensitivity/(specificity+sensitivity);
		end;
	end;
end;
